package com.lakeworks.common.domain.base;


import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @Author: Auxps
 * @Date: 2023/2/9
 * Description:
 */
@Getter
@NoArgsConstructor
@AllArgsConstructor
public class BaseDomain {
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    private Long id;

    /**
     * 创建时间
     */
    private Date createAt;

    /**
     * 创建者
     */
    private String createBy;

    /**
     * 修改时间
     */
    private Date modifyAt;

    /**
     * 修改者
     */
    private String modifyBy;

    /**
     * 统一标志
     */
    private Integer flag;

    public <B extends BaseDomain> B setId(Long id) {
        this.id = id;
        return (B) this;
    }

    public void setCreateAt(Date createAt) {
        this.createAt = createAt;
    }

    public <B extends BaseDomain> B setCreateBy(String createBy) {
        this.createBy = createBy;
        return (B) this;
    }

    public void setModifyAt(Date modifyAt) {
        this.modifyAt = modifyAt;
    }

    public <B extends BaseDomain> B setModifyBy(String modifyBy) {
        this.modifyBy = modifyBy;
        return (B) this;
    }

    public void setFlag(Integer flag) {
        this.flag = flag;
    }

}
